package com.caul.demo.hadoop.rpc.server;

import com.caul.demo.hadoop.rpc.server.impl.LoginServiceImpl;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;

import java.io.IOException;

/**
 * Created by sdliang on 2018/3/30.
 */
public class ServicePublisher {

  public static void main(String[] args) throws IOException {
    Configuration conf = new Configuration();
    RPC.Builder builder = new RPC.Builder(conf);

    builder.setBindAddress("localhost").setPort(10000).setProtocol(LoginService.class)
        .setInstance(new LoginServiceImpl());

    builder.build().start();
  }

}
